package cn.xfdzx.android.apps.shop.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import java.util.ArrayList;

import cn.xfdzx.android.apps.shop.R;
import cn.xfdzx.android.apps.shop.bean.CarManJianBeen;
import cn.xfdzx.android.apps.shop.bean.HomeClassBeen;

/**
 * @author gzk
 * @date 2020/3/28 0028
 * description：满减优惠
 */
public class CarManJianLVAdapter extends BaseAdapter {

    private Context mContext;
    private ArrayList<CarManJianBeen> mList;
    private TextView tvJian;
    private TextView tvContent;

    public CarManJianLVAdapter(Context mContext, ArrayList<CarManJianBeen> mList){
        this.mContext=mContext;
        this.mList=mList;
        addData();
    }

    private void addData() {
        mList.add(new CarManJianBeen("减","满39减3"));
        mList.add(new CarManJianBeen("减","配送费立减3元"));
        mList.add(new CarManJianBeen("爆","爆款商品0.01元起"));
    }

    @Override
    public int getCount() {
        return 3;
    }

    @Override
    public Object getItem(int i) {
        return i;
    }

    @Override
    public long getItemId(int i) {
        return 0;
    }

    @Override
    public View getView(int i, View view, ViewGroup viewGroup) {
        view=View.inflate(mContext, R.layout.item_car_man_jian,null);
        tvJian= view.findViewById(R.id.tv_jian);
        tvContent=view.findViewById(R.id.tv_content);

        tvJian.setText(mList.get(i).left);
        tvContent.setText(mList.get(i).right_content);

        return view;
    }
}
